import { createApp } from 'vue'
import App from './App.vue'
const app = createApp(App)
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
//@ts-ignore 忽略当前文件ts类型的检测否则有红色提示(打包会失败)
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import globalComponent from './components/index'
import 'virtual:svg-icons-register'
// 引入全局样式
import '@/styles/index.scss'
import router from '@/router/index.ts'
// 暗黑模式样式
import 'element-plus/theme-chalk/dark/css-vars.css'
import pinia from '@/store/index.ts'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
//引入路由鉴权文件
import './permisstion'
import 'default-passive-events'
// 自定义指令
import { isHasButton } from '@/directive/has.ts'
isHasButton(app)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(pinia)
app.use(router)
// 全局配置elementPlus国际化的配置
app.use(ElementPlus, {
  locale: zhCn,
})
app.use(globalComponent)
app.mount('#app')
